<?php

namespace App\Http\Controllers\Backend;

use App\Http\Controllers\Controller;
use App\Models\Comment;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;

class CommentController extends Controller
{
    public function index(){

        $comments = Comment::orderByDesc('id')->paginate(request('page_size', 10));
        return view('backend.comment.index',compact('comments'));
    }

    public function destroy($id){
        $comment = Comment::findOrFail($id);
        $comment->delete();

        flash('评论删除成功','success');
        return back();
    }
}
